<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateCarTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateCarLabel_registrationNumber}" for="registrationNumber" />
                    <h:inputText id="registrationNumber" value="#{carController.selected.registrationNumber}" title="#{bundle.CreateCarTitle_registrationNumber}" required="true" requiredMessage="#{bundle.CreateCarRequiredMessage_registrationNumber}"/>
                    <h:outputLabel value="#{bundle.CreateCarLabel_model}" for="model" />
                    <h:inputText id="model" value="#{carController.selected.model}" title="#{bundle.CreateCarTitle_model}" required="true" requiredMessage="#{bundle.CreateCarRequiredMessage_model}"/>
                    <h:outputLabel value="#{bundle.CreateCarLabel_brand}" for="brand" />
                    <h:inputText id="brand" value="#{carController.selected.brand}" title="#{bundle.CreateCarTitle_brand}" required="true" requiredMessage="#{bundle.CreateCarRequiredMessage_brand}"/>
                    <h:outputLabel value="#{bundle.CreateCarLabel_colour}" for="colour" />
                    <h:inputText id="colour" value="#{carController.selected.colour}" title="#{bundle.CreateCarTitle_colour}" required="true" requiredMessage="#{bundle.CreateCarRequiredMessage_colour}"/>
                    <h:outputLabel value="#{bundle.CreateCarLabel_kind}" for="kind" />
                    <h:inputText id="kind" value="#{carController.selected.kind}" title="#{bundle.CreateCarTitle_kind}" required="true" requiredMessage="#{bundle.CreateCarRequiredMessage_kind}"/>
                    <h:outputLabel value="#{bundle.CreateCarLabel_insurance}" for="insurance" />
                    <h:inputText id="insurance" value="#{carController.selected.insurance}" title="#{bundle.CreateCarTitle_insurance}" required="true" requiredMessage="#{bundle.CreateCarRequiredMessage_insurance}"/>
                    <h:outputLabel value="#{bundle.CreateCarLabel_kilometers}" for="kilometers" />
                    <h:inputText id="kilometers" value="#{carController.selected.kilometers}" title="#{bundle.CreateCarTitle_kilometers}" required="true" requiredMessage="#{bundle.CreateCarRequiredMessage_kilometers}"/>
                    <h:outputLabel value="#{bundle.CreateCarLabel_price}" for="price" />
                    <h:inputText id="price" value="#{carController.selected.price}" title="#{bundle.CreateCarTitle_price}" required="true" requiredMessage="#{bundle.CreateCarRequiredMessage_price}"/>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{carController.create}" value="#{bundle.CreateCarSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{carController.prepareList}" value="#{bundle.CreateCarShowAllLink}" immediate="true"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
